<template>
    <div class="catalogTree">
        
        <el-tree
            :data="data"
            node-key="id"
            default-expand-all
            @node-click="handleNodeClick">
            </el-tree>

    </div>
</template>


<script>
import {getAction, putAction, postAction, deleteAction} from '@/api/manage'
  export default {
    data() {
      return {
        data: [],
        defaultProps: {
          children: 'children',
          label: 'label'
        }
      };
    },
    created(){
        this.initTreeData()
        
    },
    methods: {
      initTreeData(){
          getAction('/api/sdt-flow/flowable/category/tree?parentId=0').then(res => {
                this.data = res.data.data
          })
      },
     
      handleNodeClick(data) {
          debugger
          this.curNode = data.id
          
          this.$emit('nodeClick',data.id)
      },
    }
  };
</script>

<style scoped>
.catalogTree{
    background:#FFFFFF;
    margin: 0 10px;
}
</style>>